Integrand size = 25, antiderivative size = 122 \[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {\sqrt {a-i b} (i A+B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{d}+\frac {\sqrt {a+i b} (i A-B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{d}+\frac {2 B \sqrt {a+b \tan (c+d x)}}{d} \]
[Out]
Time = 0.37 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3609, 3620, 3618, 65, 214} \[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {\sqrt {a-i b} (B+i A) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{d}+\frac {\sqrt {a+i b} (-B+i A) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{d}+\frac {2 B \sqrt {a+b \tan (c+d x)}}{d} \]
[In]
[Out]
Rule 65
Rule 214
Rule 3609
Rule 3618
Rule 3620
Rubi steps \begin{align*} \text {integral}& = \frac {2 B \sqrt {a+b \tan (c+d x)}}{d}+\int \frac {a A-b B+(A b+a B) \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx \\ & = \frac {2 B \sqrt {a+b \tan (c+d x)}}{d}+\frac {1}{2} ((a-i b) (A-i B)) \int \frac {1+i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx+\frac {1}{2} ((a+i b) (A+i B)) \int \frac {1-i \tan (c+d x)}{\sqrt {a+b \tan (c+d x)}} \, dx \\ & = \frac {2 B \sqrt {a+b \tan (c+d x)}}{d}+\frac {(i (a-i b) (A-i B)) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 d}-\frac {((i a-b) (A+i B)) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 d} \\ & = \frac {2 B \sqrt {a+b \tan (c+d x)}}{d}-\frac {((a-i b) (A-i B)) \text {Subst}\left (\int \frac {1}{-1-\frac {i a}{b}+\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{b d}-\frac {((a+i b) (A+i B)) \text {Subst}\left (\int \frac {1}{-1+\frac {i a}{b}-\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \tan (c+d x)}\right )}{b d} \\ & = -\frac {\sqrt {a-i b} (i A+B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )}{d}+\frac {\sqrt {a+i b} (i A-B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )}{d}+\frac {2 B \sqrt {a+b \tan (c+d x)}}{d} \\ \end{align*}
Time = 0.14 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.98 \[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {-i \sqrt {a-i b} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a-i b}}\right )+i \sqrt {a+i b} (A+i B) \text {arctanh}\left (\frac {\sqrt {a+b \tan (c+d x)}}{\sqrt {a+i b}}\right )+2 B \sqrt {a+b \tan (c+d x)}}{d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(811\) vs. \(2(102)=204\).
Time = 0.09 (sec) , antiderivative size = 812, normalized size of antiderivative = 6.66
method | result | size |
parts | \(\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a}{4 d b}-\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}{4 d b}+\frac {b \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) A}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}-\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a}{4 d b}+\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}{4 d b}-\frac {b \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) A}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {B \left (2 \sqrt {a +b \tan \left (d x +c \right )}-\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (a -\sqrt {a^{2}+b^{2}}\right ) \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{4}+\frac {\left (\sqrt {a^{2}+b^{2}}-a \right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{d}\) | \(812\) |
derivativedivides | \(\frac {2 B \sqrt {a +b \tan \left (d x +c \right )}}{d}-\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}{4 d b}+\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a}{4 d b}-\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{4 d}-\frac {\arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B \sqrt {a^{2}+b^{2}}}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {b \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) A}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}{4 d b}-\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a}{4 d b}+\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{4 d}+\frac {\arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B \sqrt {a^{2}+b^{2}}}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}-\frac {b \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) A}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}-\frac {\arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\) | \(968\) |
default | \(\frac {2 B \sqrt {a +b \tan \left (d x +c \right )}}{d}-\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}{4 d b}+\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a}{4 d b}-\frac {\ln \left (b \tan \left (d x +c \right )+a +\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right ) B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{4 d}-\frac {\arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B \sqrt {a^{2}+b^{2}}}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {b \arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) A}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\arctan \left (\frac {2 \sqrt {a +b \tan \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}+\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}{4 d b}-\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a}{4 d b}+\frac {\ln \left (\sqrt {a +b \tan \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \tan \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right ) B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{4 d}+\frac {\arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B \sqrt {a^{2}+b^{2}}}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}-\frac {b \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) A}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}-\frac {\arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \tan \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right ) B a}{d \sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\) | \(968\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1199 vs. \(2 (97) = 194\).
Time = 0.33 (sec) , antiderivative size = 1199, normalized size of antiderivative = 9.83 \[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int \left (A + B \tan {\left (c + d x \right )}\right ) \sqrt {a + b \tan {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Timed out. \[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\text {Timed out} \]
[In]
[Out]
Time = 10.81 (sec) , antiderivative size = 845, normalized size of antiderivative = 6.93 \[ \int \sqrt {a+b \tan (c+d x)} (A+B \tan (c+d x)) \, dx=2\,\mathrm {atanh}\left (\frac {32\,B^2\,b^4\,\sqrt {\frac {B^2\,a}{4\,d^2}-\frac {\sqrt {-B^4\,b^2\,d^4}}{4\,d^4}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{\frac {16\,B\,b^4\,\sqrt {-B^4\,b^2\,d^4}}{d^3}+\frac {16\,B\,a^2\,b^2\,\sqrt {-B^4\,b^2\,d^4}}{d^3}}-\frac {32\,a\,b^2\,\sqrt {\frac {B^2\,a}{4\,d^2}-\frac {\sqrt {-B^4\,b^2\,d^4}}{4\,d^4}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {-B^4\,b^2\,d^4}}{\frac {16\,B\,b^4\,\sqrt {-B^4\,b^2\,d^4}}{d}+\frac {16\,B\,a^2\,b^2\,\sqrt {-B^4\,b^2\,d^4}}{d}}\right )\,\sqrt {-\frac {\sqrt {-B^4\,b^2\,d^4}-B^2\,a\,d^2}{4\,d^4}}-\mathrm {atanh}\left (\frac {d^3\,\left (\frac {16\,\left (A^2\,b^4-A^2\,a^2\,b^2\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^2}-\frac {16\,a\,b^2\,\left (\sqrt {-A^4\,b^2\,d^4}-A^2\,a\,d^2\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^4}\right )\,\sqrt {\frac {\sqrt {-A^4\,b^2\,d^4}-A^2\,a\,d^2}{d^4}}}{16\,\left (A^3\,a^2\,b^3+A^3\,b^5\right )}\right )\,\sqrt {\frac {\sqrt {-A^4\,b^2\,d^4}-A^2\,a\,d^2}{d^4}}-2\,\mathrm {atanh}\left (\frac {32\,B^2\,b^4\,\sqrt {\frac {\sqrt {-B^4\,b^2\,d^4}}{4\,d^4}+\frac {B^2\,a}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{\frac {16\,B\,b^4\,\sqrt {-B^4\,b^2\,d^4}}{d^3}+\frac {16\,B\,a^2\,b^2\,\sqrt {-B^4\,b^2\,d^4}}{d^3}}+\frac {32\,a\,b^2\,\sqrt {\frac {\sqrt {-B^4\,b^2\,d^4}}{4\,d^4}+\frac {B^2\,a}{4\,d^2}}\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {-B^4\,b^2\,d^4}}{\frac {16\,B\,b^4\,\sqrt {-B^4\,b^2\,d^4}}{d}+\frac {16\,B\,a^2\,b^2\,\sqrt {-B^4\,b^2\,d^4}}{d}}\right )\,\sqrt {\frac {\sqrt {-B^4\,b^2\,d^4}+B^2\,a\,d^2}{4\,d^4}}-\mathrm {atanh}\left (\frac {d^3\,\left (\frac {16\,\left (A^2\,b^4-A^2\,a^2\,b^2\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^2}+\frac {16\,a\,b^2\,\left (\sqrt {-A^4\,b^2\,d^4}+A^2\,a\,d^2\right )\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d^4}\right )\,\sqrt {-\frac {\sqrt {-A^4\,b^2\,d^4}+A^2\,a\,d^2}{d^4}}}{16\,\left (A^3\,a^2\,b^3+A^3\,b^5\right )}\right )\,\sqrt {-\frac {\sqrt {-A^4\,b^2\,d^4}+A^2\,a\,d^2}{d^4}}+\frac {2\,B\,\sqrt {a+b\,\mathrm {tan}\left (c+d\,x\right )}}{d} \]
[In]
[Out]